package com.caituo.idouyou.user.service.Impl;

import java.util.Map;

import javax.servlet.http.HttpServletRequest;

import org.apache.struts2.ServletActionContext;

import com.caituo.idouyou.user.common.exception.ResultCodeIsNullException;
import com.caituo.idouyou.user.common.exception.UnLoginException;
import com.caituo.idouyou.user.service.LoginService;
import com.caituo.idouyou.user.system.domain.BaseDomain;
import com.caituo.idouyou.user.system.service.BaseService;
import com.opensymphony.xwork2.ActionContext;

public class LoginServiceImpl implements LoginService{

	@Override
	public boolean isLogin() throws Exception{
		
			ActionContext actiobContext = ActionContext.getContext();  
			Map paramsMap = actiobContext.getParameters();  
			HttpServletRequest request = ServletActionContext.getRequest();
			String name = ((String[])paramsMap.get("userDomain.name"))[0];
			String pwd = ((String [])paramsMap.get("userDomain.pwd"))[0];
			if(name==null||"".equals(name)|| pwd==null||"".equals(pwd)){
				throw new UnLoginException("the login name or pwd is null");
			}
		return true;
	}

	
	
	
	
}
